import Vue from 'vue'
import Vuex from 'vuex'
import axios from "@/axios"
import saveInLocal from './plugin/savaInlocal'

//挂载Vuex
Vue.use(Vuex)

//创建VueX对象
const store = new Vuex.Store({
    state: {
        // //存放的键值对就是所要管理的状态
        // leftStatus: false,
        // userinfo: {}
    },

    mutations: {
        // setLeftStatus(state, status) {
        //     state.leftStatus = status
        // },

        // setUserinfo(state, info) {
        //     state.userinfo = info
        // }
    },

    actions: {
        // updateUserinfo(content) {
        //     return new Promise(resolve => {
        //         axios.get("/Account/getIdentity").then(res => {
        //             content.commit("setUserinfo", res.data);
        //         });
        //         resolve()
        //     })
        // }
    },

    plugins: [saveInLocal]
})

export default store